package pers.zxk.jlytnews.dao;

import pers.zxk.jlytnews.entity.WxArticle;
import pers.zxk.jlytnews.entity.WxArticleTiny;
import pers.zxk.jlytnews.entity.WxArticleToClient;

import java.sql.SQLException;
import java.util.List;

/**
 * 微信文章接口
 */
public interface WxArticleDao {
    //添加本地新闻
    public boolean addWxArticle(String aid, long appmsgid, int itemidx, String cover, String link, String title, int create_time, int update_time, String media_duration, int mediaapi_publish_status, String fakeid) throws SQLException, ClassNotFoundException;

    //通过id删除新闻
    public boolean delWxArticle(int id) throws SQLException, ClassNotFoundException;

    //通过id更新新闻
    public boolean updateWxArticle(int id, String aid, long appmsgid, int itemidx, String cover, String link, String title, int create_time, int update_time, String media_duration, int mediaapi_publish_status, String fakeid) throws SQLException, ClassNotFoundException;

    //通过id获取新闻
    public WxArticle getWxArticle(int id) throws SQLException, ClassNotFoundException;

    //返回最近发布的新闻列表,count<=0返回全部新闻
    public List<WxArticle> getLatestWxArticle(int count) throws SQLException, ClassNotFoundException;

    //public List<WxArticle> getWxArticleList(int page,int size) throws SQLException, ClassNotFoundException;
    public List<WxArticleToClient> getWxArticleList(int page, int size) throws SQLException, ClassNotFoundException;

    //public List<WxArticle> getWxArticleList(int page,int size,String fakeid) throws SQLException, ClassNotFoundException;
    public List<WxArticleToClient> getWxArticleList(int page, int size, String fakeid) throws SQLException, ClassNotFoundException;

    //获取全部文章信息（aid，create_time，fakeid）
    @Deprecated
    public List<WxArticleTiny> getWxArticleTinyList() throws SQLException, ClassNotFoundException;

    //获取文章Id列表
    public List<String> getAidList(String fakeid, int startTime, int endTime) throws SQLException, ClassNotFoundException;

}
